$("#yincang").click(function(){
	location.href = `${IP}/detail.html`
})
let username = sessionStorage.getItem("username");
let ID = localStorage.getItem("id")
if(username){
	$(".hidden2 button").hide()
	$(".hidden2 p").html("退出").click(function(){
		sessionStorage.clear();
		history.go(0)
		location.href = `${IP}/index.html`
		localStorage.clear()
	})
	$(".top-t ul a").html("我的帐户")
	if(ID){
		con = ID.split("*")
		id = con[0]
		num = con[1]
		$(".top-t ul span").html(`(${num})`)
	}
	$(".top-t ul li").eq(2).click(function(){
		location.href = `${IP}/gouwuche.html`
	})
}else{
	$(".hidden2 button").click(function(){
		location.href = `${IP}/login.html`
	})
	$(".hidden2 p").click(function(){
		location.href = `${IP}/register.html`
	})
	$(".top-t ul li").eq(2).click(function(){
		alert("请先进行登录！")
		location.href = `${IP}/login.html`
	})
	localStorage.clear()
}
$("#index").click(function(){
	location.href =  `${IP}/index.html`
})
$(".hidden2 li").eq(0).click(function(){
	if(username){
		location.href =  `${IP}/person.html`
	}else{
		alert("请先进行登录！")
		location.href = `${IP}/login.html`
	}
})
